<?php
if (is_plugin_enabled('groups')){
/*******************************************************************************
 * 3 column dashboard
 * 3 column replacement riverdashboard view for my groups
 *
 * @package 3 column dashboard
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Fusion <contact@donkeydesigns.us>
 * @copyright TheFloridaCircle.com 2008-2009
 * @link http://www.thefloridacircle.com/
 * Thanks to Cube
 ******************************************************************************/
?>
<div id="river_container2">
<div class="dash_pad">

<div class="sidebarBox">
            <h3><?php echo elgg_echo("river:groups:mygroup"); ?></h3>
<div class="membersWrapper1">

<?php
   // Get the number of events to display
    $groupsNumToDisplay = get_plugin_setting('groupsNumToDisplay','riverdashboard');
      
    //$groups = get_users_membership($_SESSION);
    //$groups = list_entities_from_relationship('member',$_SESSION['guid'],false,'group','',0,$number,false,false,false);
    $groups = get_entities_from_relationship('member', $_SESSION['guid'], false, "group", "", 0, "", $groupsNumToDisplay, 0, false, 0);
    

    if($groups){
        
        echo "<div class=\"groupmembershipwidget\">";

        foreach($groups as $group){
            $icon = elgg_view(
                "groups/icon", array(
                                    'entity' => $group,
                                    'size' => 'small',
                                  )
                );
                
            echo "<div class=\"contentWrapper\" style=\"border:none;\">" . $icon . " <div class='search_listing_info'><p><span>" . $group->name . "</span><br />";
            echo $group->briefdescription . "</p></div><div class=\"clearfloat\"></div></div>";
            
        }
        echo "</div>";
    }

   // echo $groups;
      
?>

<div class="clearfloat"></div>
</div>
</div>

</div>
</div>
<?php } ?>